Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: logcollection to OpenSearch in non-debug clusters #2080

Merged
merged 24 commits into from
Aug 21, 2023

Conversation

msanft
Copy link
Contributor

@msanft msanft commented Jul 10, 2023

Context

Previously, Filebeat and Logstash (our utilities for logcollection to OpenSearch) were only deployed through the debugd, which only got deployed in debug-clusters. We can also deploy Filebeat and Logstash through Helm as a Kubernetes deployment, allowing us to also deploy it in non-debug clusters. This should also be helpful in resolving this bug, as we are able to retrieve systemd-logs after the debugd runs. (i.e. when Kubernetes runs)

Proposed change(s)

  • Create a hack-script hack/logcollector which retrieves and templates the configuration files into the format that the Elastic Helm charts need. This seems to be very complex for a small problem, but it will allow us to keep a consistent log format between non-debug and debug cluster logs, as we only specify the output format in debugd/{filebeat,logstash} and don't have duplication.
  • Create a workflow which deploys Filebeat and Logstash in e2e runs. (temporarily deploy without any condition, i.e. also in debug clusters, to resolve the above mentioned bug)

TODO

Checklist

  • Update docs
  • Add labels (e.g., for changelog category)
  • Is PR title adequate for changelog?
  • Link to Milestone

@msanft msanft added the no changelog Change won't be listed in release changelog label Jul 10, 2023
@msanft msanft added this to the v2.10.0 milestone Jul 10, 2023
@netlify
Copy link

netlify bot commented Jul 10, 2023

Deploy Preview for constellation-docs canceled.

Name Link
🔨 Latest commit 0a3afe1
🔍 Latest deploy log https://app.netlify.com/sites/constellation-docs/deploys/64df42afe9f7e40009d3d3d1

@msanft msanft force-pushed the feat/hack/opensearch-logcollect branch from 1e68914 to d6f60e3 Compare July 12, 2023 07:25
@msanft msanft marked this pull request as ready for review July 12, 2023 07:25
@msanft msanft requested a review from malt3 as a code owner July 12, 2023 07:25
@elchead
Copy link
Contributor

elchead commented Jul 12, 2023

sry for the late review. having a look today. did you already run an E2E test to test if logs are uploaded on OS?

@msanft
Copy link
Contributor Author

msanft commented Jul 12, 2023

sry for the late review. having a look today. did you already run an E2E test to test if logs are uploaded on OS?

Yes, they are :-)

@elchead
Copy link
Contributor

elchead commented Jul 12, 2023

@msanft you can rebase to fix govulncheck

@elchead
Copy link
Contributor

elchead commented Jul 12, 2023

nit: remove "Previously, " from description. Otherwise nice description :)

@msanft msanft force-pushed the feat/hack/opensearch-logcollect branch from a1676cf to 4f85ac4 Compare July 12, 2023 08:03
@elchead
Copy link
Contributor

elchead commented Jul 12, 2023

otherwise, looks good to me. Very clean work :)

@msanft
Copy link
Contributor Author

msanft commented Jul 13, 2023

e2e run with new container images
corresponding logs

@elchead
Copy link
Contributor

elchead commented Jul 13, 2023

e2e run with new container images corresponding logs

maybe it's useful to add the jobname to the metadata and not just the workflow name? Makes it easier to filter

@msanft
Copy link
Contributor Author

msanft commented Jul 13, 2023

e2e run with new container images corresponding logs

maybe it's useful to add the jobname to the metadata and not just the workflow name? Makes it easier to filter

It's unfortunately not exposed by GitHub: https://docs.github.com/en/actions/learn-github-actions/contexts#github-context

@msanft
Copy link
Contributor Author

msanft commented Jul 14, 2023

Turning this back into a draft until missing journald logs are resolved

@msanft msanft marked this pull request as draft July 14, 2023 08:27
@msanft msanft force-pushed the feat/hack/opensearch-logcollect branch 2 times, most recently from e40face to 7a9dc8b Compare July 14, 2023 13:31
@msanft msanft force-pushed the feat/hack/opensearch-logcollect branch from 1753d7c to 335f6dc Compare August 18, 2023 08:47
msanft and others added 3 commits August 18, 2023 11:22
This fixes the output paths of builds within the container by mounting
directories to paths that exist on the host. We also explicitly set the
output path in a .bazelrc to the user specific path. The rc file is
mounted into the container and overrides the host rc.
Also adding automatic stop in case start is called and a containers
is already running.
Sym links like bazel-out and paths bazel outputs should generally work
with this change.

Signed-off-by: Paul Meyer <[email protected]>
@msanft
Copy link
Contributor Author

msanft commented Aug 18, 2023

e2e
corresponding logs

Copy link
Contributor

@elchead elchead left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code is functional, lgtm

@msanft msanft merged commit 60bf770 into main Aug 21, 2023
12 checks passed
@msanft msanft deleted the feat/hack/opensearch-logcollect branch August 21, 2023 06:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no changelog Change won't be listed in release changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants